package com.uni.bgController;

import com.uni.common.entity.DictKey;
import com.uni.common.util.ReturnData;
import com.uni.service.impl.DictKeyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 字典
 * @author yuyanzheng
 *
 */
@RestController
@RequestMapping("dictKey")
public class DictKeyControllerbg {
	
	@Autowired
	private DictKeyService dictKeyService;
	
	@RequestMapping("findList")
	public ReturnData findList(String type) {
		ReturnData rd = new ReturnData();
		if(StringUtils.isBlank(type)) {
			return rd.failBack("类型不能为空");
		}
		List<DictKey> dicts = dictKeyService.findByType(type);
		return rd.okBack(dicts);
	}
}
